package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: dh
 * @date: 2023-10-26 15:14
 * 创建一个类实现BookService的接口，并重写其中的方法.
 */
//@Component
@Service
public class BookServiceImpl implements BookService {

    // 1.声明一个属性
    @Autowired
    private BookDao bookDao;

    // 2.提供一个set方法
    public void setBookDao(BookDao bookDao) {

        this.bookDao = bookDao;
    }

    @Override
    public void save() {

        System.out.println("book service save ...");
        bookDao.save();;
    }
}
